<%@ page pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="/pages/head.jsp">
	<jsp:param value="用户信息管理" name="title" />
</jsp:include>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-1 col-0"></div>
<div class="col-md-10 col-12">
<div class="card border">
	<div class="card-header">
		<form class="form-inline"
			action="${pageContext.request.contextPath }/list_user.action"
			method="post">
			<div class="form-group">
				<input class="form-control mr-sm-2" type="text" name="s_un"
					value="${param.s_un }" placeholder="请输入用户名" />
			</div>
			<div class="form-group">
				<button class="btn btn-outline-primary my-2 my-sm-0"
					type="submit">搜索</button>
			</div>
		</form>
	</div>
	<div class="card-body">
		<div class="table-responsive-xl">
			<table class="table table-striped table-hover">
				<thead>
					<tr><th>#</th><th>用户名</th>
						<th>角色</th><th>电话</th>
						<th>地址</th><th>操作</th>
					</tr>
				</thead>
				<tbody>
				<c:forEach items="${requestScope.users }" var="user" varStatus="vs">
				<tr>
					<th>${vs.count }</th>
					<td><c:out value="${user.username }" escapeXml="true" /></td>
					<td>${(user.ident=="1") ? "管理员" : "普通用户" }</td>
					<td><c:out value="${user.telephone }" escapeXml="true" /></td>
					<td><c:out value="${user.address }" escapeXml="true" /></td>
					<td><a href="del_user?id=${user.id }" onclick="return confirm('确定要删除吗？')">删除</a>
				</tr>
				</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
	</div>
	</div>
</div>
</div>
</body>
</html>